In a nutshell, you are going to create a C# project, add some classes and then add the DLL to the FitNesse path so that FitNesse can find and execute your C# Fixtures.
Start Visual Studio
Create a new Project (File:New:Project:Visual C#:Class Library) (I used C:\Projects\C_Sharp for the directory, Digital Video Recorder for the Name and Solution Name)
Create Fixture to back Test Table
Visual Studio creates a class called Class1.cs in the namespace DigitalVideoRecorder by default, rename Class1.cs to CreatePrograms.
Remove all of the using statements automatically inserted by Visual Studio
Save and build your solution.
Determine Where Visual Studio Stores Your Generated DLL
The DLL should be under the bin\Debug directory. In my case, the full path to my DLL is:
C:\Projects\C_Sharp\DigitalVideoRecorder\DigitalVideoRecorder\bin\Debug
Update Page to have NSlim Configuration
Add the required configuration to the top of your DigitalVideoRecorder page:
Click on the Test button, you should see some green and red now:
You have two tables in your page. The first table is an import table, it tells FitNesse to import that namespace (i.e. like using in .Net). That is, when looking for fixture classes (classes that process tables), look in this namespace. If you want to import multiple namespaces, use multiple rows (or duplicate the entire table).
The second table is a decision table. (Those familiar with Fit, may recognize the similarity between Decision Tables and Column Fixtures.) The first row names a class, CreatePrograms in this case. You created this class above. The second row names the columns. Column headers that do not have a question mark in their name require a "set" method to back them. Column headers with a question mark require a method that returns a value. In our case we have 6 columns, so we need to add 6 methods, 5 setters and one method which returns a value. Here's the complete "stub" class to get this table fully passing:
Table of Contents
Create C# Project
In a nutshell, you are going to create a C# project, add some classes and then add the DLL to the FitNesse path so that FitNesse can find and execute your C# Fixtures.Create Fixture to back Test Table
Determine Where Visual Studio Stores Your Generated DLL
C:\Projects\C_Sharp\DigitalVideoRecorder\DigitalVideoRecorder\bin\Debug
Update Page to have NSlim Configuration
!define TEST_SYSTEM {slim} !define COMMAND_PATTERN {%m -r fitSharp.Slim.Service.Runner,c:\tools\nslim\fitsharp.dll %p} !define TEST_RUNNER {c:\tools\nslim\Runner.exe}Add your code to Path
!define TEST_SYSTEM {slim} !define COMMAND_PATTERN {%m -r fitSharp.Slim.Service.Runner,c:\tools\nslim\fitsharp.dll %p} !define TEST_RUNNER {c:\tools\nslim\Runner.exe} !path C:\Projects\C_Sharp\DigitalVideoRecorder\DigitalVideoRecorder\bin\Debug\DigitalVideoRecorder.dll !define COLLAPSE_SETUP {true} !define COLLAPSE_TEARDOWN {true} !|import| |DigitalVideoRecorder| !|Create Programs| |Name|Channel|DayOfWeek|TimeOfDay|DurationInMinutes|id?| |House|4|Monday|19:00|60|$ID=|You have two tables in your page. The first table is an import table, it tells FitNesse to import that namespace (i.e. like using in .Net). That is, when looking for fixture classes (classes that process tables), look in this namespace. If you want to import multiple namespaces, use multiple rows (or duplicate the entire table).
The second table is a decision table. (Those familiar with Fit, may recognize the similarity between Decision Tables and Column Fixtures.) The first row names a class, CreatePrograms in this case. You created this class above. The second row names the columns. Column headers that do not have a question mark in their name require a "set" method to back them. Column headers with a question mark require a method that returns a value. In our case we have 6 columns, so we need to add 6 methods, 5 setters and one method which returns a value. Here's the complete "stub" class to get this table fully passing:
Verify Your Tests Pass
Return and Complete Your Tutorial